package weixintozfbrouter

import (
	"github.com/gin-gonic/gin"
	"yundian/internel/app/handlers/alipay"
	"yundian/internel/app/middlewares"
	"yundian/internel/pkg/dingo"
)

func InitAilPayRouter() dingo.ApiRouter {
	return func(g *gin.RouterGroup) {
		{
			r := g.Group("wx/alipay")
			r.POST("login", alipay.HandlerAliPayLogin)

			r.Use(middlewares.JwtZfbAuthMiddleware) // 加载中间件 - 授权需要登录

			r.POST("create-charge-order", alipay.HandleCreateChargeOrder)          // 创建充电订单
			r.POST("create-automate-order", alipay.HandleAutomateCreateGoodsOrder) // 创建售货订单
			r.POST("create-room-order", alipay.HandleCreateRoomOrder)              // 创建续住订单
			r.POST("create-goods-order", alipay.HandleCreateGoodsOrder)            // 创建超市订单
			r.POST("again-goods-order", alipay.HandleAgainGoodsOrder)              // 超市订单-重新支付
		}
	}
}
